﻿<%@ Page Title="Promotion Engine - Promotion Setup" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="PromotionInfor.aspx.cs" Inherits="PromotionEngine.PromotionInfor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <style>
        a.one:link
        {
            color: #ff0000;
        }
        a.one:visited
        {
            color: #0000ff;
        }
        a.one:hover
        {
            color: orange;
        }
        
        a.two:link
        {
            color: #ff0000;
        }
        a.two:visited
        {
            color: #0000ff;
        }
        a.two:hover
        {
            font-size: 150%;
        }
        
        a.three:link
        {
            color: #ff0000;
        }
        a.three:visited
        {
            color: #0000ff;
        }
        a.three:hover
        {
            background: #66ff66;
        }
        
        a.four:link
        {
            color: #ff0000;
        }
        a.four:visited
        {
            color: #0000ff;
        }
        a.four:hover
        {
            font-family: monospace;
        }
        
        a.five:link
        {
            color: #ff0000;
            text-decoration: none;
        }
        a.five:visited
        {
            color: #0000ff;
            text-decoration: none;
        }
        a.five:hover
        {
            text-decoration: underline;
        }
    </style>
    <script type="text/javascript">
        var ts;
        var promotionID, promotionCode, promotionName;
        var params;
        $(document).ready(function () {
            promotionID = $('#PromotionID').val();
            promotionCode = $('#PromotionCode').val();
            promotionName = $('#PromotionName').val();
            param = "PromotionID=" + promotionID + "&PromotionCode=" + promotionCode + "&PromotionName=" + promotionName + "";
            $('#tabStrip').hide();
        });
        function LoadPromotionCode(promotionCode, promotionName, promotionID) {
            $("#PromotionCode").val(promotionCode);
            $("#PromotionName").val(promotionName);
            $("#PromotionID").val(promotionID);
            $("#PromotionList").data("kendoWindow").close();
            promotionID = $('#PromotionID').val();
            promotionCode = $('#PromotionCode').val();
            promotionName = $('#PromotionName').val();
            param = "PromotionID=" + promotionID + "&PromotionCode=" + promotionCode + "&PromotionName=" + promotionName + "";
            ts = $("#tabStrip").kendoTabStrip({
                animation: { open: { effects: "fadeIn"} },
                contentUrls: [
                        'PromotionDetailForView.aspx?PromotionID=' + promotionID + '&IsInsert=false',
                        '/PromotionCustomerInclude.aspx?' + param,
                        '/PromotionCustomerExclude.aspx?' + param,
                        '/PromotionDocumentPropertyInclusive.aspx?' + param,
                        '/PromotionDocumentPropertyExclusive.aspx?' + param,
                        '/PromotionDocumentLinePropertyInclusive.aspx?' + param,
                        '/PromotionDocumentLinePropertyExclusive.aspx?' + param,
                        '/PromotionItemGet.aspx?' + param,
                        '/PromotionItemBuy.aspx?' + param,
                        '/PromotionItemExclusive.aspx?' + param,
                        '/PromotionWarehouseExclude.aspx?' + param,
                        '/PromotionWarehouseInclude.aspx?' + param
                    ]
            }).data('kendoTabStrip');
            ts.tabGroup.on('click', 'li', function (e) {
                ts.reload($(this));
            });
            var selectedTab = ts.select();
            ts.reload(selectedTab);
            $('#tabStrip').show();
        }
        function OpenPromotionList() {
            $("#PromotionList").empty();
            var wnd = $("#PromotionList")
                        .kendoWindow({
                            title: "List of Promotions",
                            modal: true,
                            visible: false,
                            resizable: false,
                            width: 1000,
                            height: 550,
                            content: { type: "POST", url: "PromotionList.aspx", data: {} },
                            iframe: true
                        }).data("kendoWindow");

            wnd.center().open();
        }
        function OpenPromotionDetail() {
            $("#PromotionDetail").empty();
            var promotionID = $("#PromotionID").val();
            if (promotionID != '') {
                var wnd = $("#PromotionDetail")
                        .kendoWindow({
                            title: "Detail of Promotion",
                            modal: true,
                            visible: false,
                            resizable: false,
                            width: 1150,
                            height: 450,
                            content: { type: "POST", url: "PromotionDetailForView.aspx?PromotionID=" + promotionID + "&IsInsert=false", data: {} },
                            iframe: true
                        }).data("kendoWindow");

                wnd.center().open();
            }
        }
      
    </script>
    <div id="PromotionList">
    </div>
    <div id="PromotionDetail">
    </div>
    <table border="0">
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                Promotion
            </td>
            <td>
                <input id="PromotionID" class="k-input k-textbox" name="PromotionID" readonly="readonly"
                    type="text" style="width: 100px; display: none;" />
                <input id="PromotionCode" class="k-input k-textbox" name="PromotionCode" readonly="readonly"
                    type="text" style="width: 100px;" />
            </td>
            <td>
                <input id="PromotionName" class="k-input k-textbox" name="PromotionName" readonly="readonly"
                    type="text" style="width: 500px;" />
            </td>
            <td>
                <span class="k-icon k-i-search" style="margin-left: 0px; width: 16px; cursor: pointer;"
                    onclick="OpenPromotionList()" title="Choose Promotion" id="fatherCode"></span>
            </td>
            <%--<td align="right" style="width: 100%">
                <a href="#" onclick="OpenPromotionDetail()" class="one"><strong><em>View promotion detail</em></strong></a>
            </td>--%>
        </tr>
    </table>
    <hr />
    <div style="position: absolute; z-index: 0; margin-right: 0px; width: 99%;">
        <div id="tabStrip" style="width: 100%;">
            <ul>
                <li class="k-state-active">Promotion</li>
                <li>Cust. In </li>
                <li>Cust. Ex </li>
                <li>Doc. Prop In </li>
                <li>Doc. Prop Ex </li>
                <li>Doc. Line Prop In </li>
                <li>Doc. Line Prop Ex </li>
                <li>Item Buy </li>
                <li>Item Get </li>
                <li>Item Ex </li>
                <li>Warehouse In </li>
                <li>Warehouse Ex </li>
                 <li>Point Setup</li>
            </ul>
        </div>
    </div>
</asp:Content>
